<%@ page import="com.guotd.ticketSystem.entity.Schedule" %>
<%@ page import="java.util.List" %>
<%@page pageEncoding="UTF-8" contentType="text/html; UTF-8" isELIgnored="false" %>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>时间表列表</title>
    <link rel="stylesheet" href="css/list.css">
</head>
<body>
<%
    if (session.getAttribute("schedule_msg") != null)
    {
%>
<h2><%= session.getAttribute("schedule_msg") %></h2>
<%
    }
%>
<a href="schedule_add.jsp" class="table-button">添加时间表信息</a>
<a href="index_admin.jsp" class="table-button">回到主页</a>
<% List<Schedule> scheduls= (List<Schedule>) session.getAttribute("schedules"); %>
<table>
    <tr>
        <th>编号</th>
        <th>出发日期</th>
        <th>出发时间</th>
        <th>到达日期</th>
        <th>到达时间</th>
        <th colspan="2">操作</th>
    </tr>
    <%
        if(scheduls!=null){
            for (Schedule s : scheduls) {
    %>
    <tr>
        <td> <%=s.getId()%> </td>
        <td> <%=s.getFromDate()%> </td>
        <td> <%=s.getFromTime()%> </td>
        <td> <%=s.getToDate()%> </td>
        <td> <%=s.getToTime()%> </td>
        <td> <a href="delSchedule?id=<%=s.getId()%>" class="table-button">删除</a> </td>
        <td> <a href="schedule_edit.jsp?id=<%=s.getId()%>&&fromDate=<%=s.getFromDate()%>&&fromTime=<%=s.getFromTime()%>&&toDate=<%=s.getToDate()%>&&toTime=<%=s.getToTime()%>" class="table-button">编辑</a> </td>
    </tr>
    <%
            }
        }
    %>
</table>
</body>
</html>